<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>[%$softtitle%]</title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/clickmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodyauto")){
			$('.manageadd').css({height:h-40});
			$('.manageedit').css({height:h-40});
		}
	}
	var typemanage_type_add_upid  = "[%$ST.typemanage_type_add_upid%]";
	var typemanage_js_noselect_empty  = "[%$ST.typemanage_js_noselect_empty%]";
	var typemanage_js_typename_empty  = "[%$ST.typemanage_js_typename_empty%]";
	var typemanage_js_dirname_empty  = "[%$ST.typemanage_js_dirname_empty%]";
	var typemanage_js_widthhieht_empty  = "[%$ST.typemanage_js_widthhieht_empty%]";
	var typemanage_js_template_empty  = "[%$ST.typemanage_js_template_empty%]";
	var typemanage_js_typeurl_empty  = "[%$ST.typemanage_js_typeurl_empty%]";
	var typemanage_js_type_shift_typeselect_err  = "[%$ST.typemanage_js_type_shift_typeselect_err%]";
	var typemanage_js_type_edit_ok = "[%$ST.typemanage_js_type_edit_ok%]";
	var typemanage_js_type_edit_no = "[%$ST.typemanage_js_type_edit_no%]";
	var iframename = "[%$iframename%]";
	$(document).ready(function(){
		var h = '[%$iframeheightwindow%]';
		$('.manageadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse
		}
		$('#typeedit').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['inputupid']!=0){
			if(get['upid']==0){
				document.typeedit.upid.focus();
				alert(typemanage_type_add_upid+typemanage_js_noselect_empty);
				return false;
			}
			if(get['upid']==get['tid']){
				document.typeedit.upid.focus();
				alert(typemanage_js_type_shift_typeselect_err);
				return false;
			}
		}
		if(get['typename']==''){
			document.typeedit.typename.focus();
			alert(typemanage_js_typename_empty);
			return false;
		}
		if(get['width']!='' || get['height']!=''){
			if(get['width'].match(/^[0-9]+$/ig)==null || get['height'].match(/^[0-9]+$/ig)==null ) {
				document.typeedit.width.focus();
				alert(typemanage_js_widthhieht_empty);
				return false;
			}
		}
		if(get['styleid']==1 || get['styleid']==2 || get['styleid']==4){
			if(get['template'].match(/^[\w]+$/ig)==null || get['readtemplate'].match(/^[\w]+$/ig)==null || get['filenamestyle'].match(/^[\{\}\w-]+$/ig)==null || get['readnamestyle'].match(/^[\{\}\w-]+$/ig)==null ) {
				document.typeedit.template.focus();
				alert(typemanage_js_template_empty);
				return false;
			}
		}else{
			if(get['typeurl'].match(/^http:\/\/[a-zA-Z.0-9-%&?=/_]+$/ig)==null) {
				document.typeedit.typeurl.focus();
				alert(typemanage_js_typeurl_empty);
				return false;
			}
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			parent.frames[iframename].refresh('selectform','selectall','check_all');
			alert(typemanage_js_type_edit_ok);
		}else{
			alert(typemanage_js_type_edit_ok);
		}
		parent.onaletdoc()
	}
</script>
</head>

<body>
<form name="typeedit" id="typeedit" method="post" action="index.php?archive=typemanage&action=typesave">
	<input type="hidden" name="inputclass" value="edit">
	<input type="hidden" name="tid" value="[%$typeread.tid%]">
	<input type="hidden" name="inputupid" id="inputupid" value="[%$typeread.upid%]">
	<input type="hidden" name="topid" value="[%$typeread.topid%]">
	<input type="hidden" name="lng" value="[%$typeread.lng%]">
	<div id="mainbodyauto" class="manageadd">
		<div class="maindobycontent">
			<!--查看已选择的类型-->
			<div class="suggestion">
				<span class="sugicon"><span class="strong colorgorning2">[%$ST.position_title%]</span><span class="colorgorningage">[%$ST.typemanage_type_edit_mess%] <u>[%$typeread.typename%]</u></span></span>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.typemanage_type_add_typelngmode%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_lng%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$typeread.lng%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_mid%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$model%]</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_dirname%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$typeread.dirname%]<input type="hidden" name="dirname" value="[%$typeread.dirname%]"></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_dirpath%]</td>
						<td width="85%" class="trtitle02 colorgblue">[%$pathdir%][%if $is_alonelng!=1%][%$typeread.lng%]/[%/if%][%$typeread.dirpath%]</td>
					</tr>
					<tr class="trstyle2 [%if $typeread.upid==0%]displaynone[%else%]displaytrue[%/if%]">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_upid%]</td>
						<td width="85%" class="trtitle02">
							[%if $typeread.upid==0%]
							<input type="hidden" name="upid" value="0">
							[%else%]
							<select size="1" name="upid" id="upid">
								<option value="0">[%$ST.typemanage_type_add_upid_option2%]</option>
								[%forlist from=$typelist key=list%]
								<option [%$typelist[list].selected%] value="[%$typelist[list].tid%]">├─[%$typelist[list].level|treelist('─')%] [%$typelist[list].typename%]</option>
								[%/forlist%]
							</select>
							[%/if%]
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_purview%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="purview" id="purview">
								<option value="0">[%$ST.typemanage_type_add_purview_option%]</option>
								[%forlist from=$memberpuvlist key=list%]
								<option [%$memberpuvlist[list].selected%] value="[%$memberpuvlist[list].mcid%]">[%$memberpuvlist[list].rankname%]</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
				</table>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.typemanage_type_add_typenamekeytext%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_editlist%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="beedit" checked="checked"/> [%$ST.is_yes%]&nbsp;
							<input type="radio" value="0" name="beedit"/> [%$ST.is_no%]
							<span class="cautiontitle">[%$ST.typemanage_type_add_editlist_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_editlist2%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="beistemplatesedit"/> [%$ST.is_yes%]&nbsp;
							<input type="radio" value="0" name="beistemplatesedit" checked="checked"/> [%$ST.is_no%]
							<span class="cautiontitle">[%$ST.typemanage_type_add_editlist2_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_typename%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="typename" size="40" value="[%$typeread.typename%]" maxlength="150" class="infoInput"/>
							<span class="cautiontitle">[%$ST.typemanage_type_add_typename_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_keywords%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="keywords" value="[%$typeread.keywords%]" size="50" maxlength="50" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selectkeyword_botton%]','iframe:index.php?archive=seomanage&action=listtab&inputtext=keywords&lng=[%$view.lng%]&listfunction=keywordlist&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">[%$ST.selectkeyword_botton%]</a>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="ktid" id="ktid" onchange="javascript:updatekeywords(this.value,'keywords')">
								<option selected="selected" value="">[%$ST.article_doc_add_ktid_option%]</option>
								[%forlist from=$keyarray key=list%]
								<option value="[%$keyarray[list].keyworklist%]">[%$keyarray[list].keytypename%]([%$keyarray[list].keyworklist|cutstr(25)%])</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_description%]</td>
						<td width="85%" class="trtitle02">
							<textarea name="description" cols="50" rows="3" class="smallInput" style="width:95%">[%$typeread.description%]</textarea>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="ktid" id="ktid" onchange="javascript:updatekeywords(this.value,'description')">
								<option selected="selected" value="">[%$ST.article_doc_add_ktid_option2%]</option>
								[%forlist from=$keyarray key=list%]
								<option value="[%$keyarray[list].description%]">[%$keyarray[list].keytypename%]([%$keyarray[list].description|cutstr(35)%])</option>
								[%/forlist%]
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"></td>
						<td width="85%" class="trtitle02">
							<span class="cautiontitle">[%$ST.typemanage_type_add_description_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_content%]</td>
						<td width="85%" class="trtitle02"><textarea name="content" cols="50" rows="5" class="smallInput" style="width:95%">[%$typeread.content%]</textarea></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_typepic%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="typepic" id="typepic" value="[%$typeread.typepic%]" size="40" maxlength="50" class="infoInput"/>
							<a class="filecheck" onclick="javascript:parent.windowsdig('[%$ST.filemanage_select_title%]','iframe:index.php?archive=filemanage&action=filemanage&listfunction=filelist&filetype=img&checkfrom=input&fileinputid=typepic&iframename='+self.frameElement.getAttribute('name'),'900px','480px','iframe')" href="#body">[%$ST.selectfile_botton%]</a>
							<span class="cautiontitle">[%$ST.typemanage_type_add_typepic_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_typepic_size%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="width" size="5" maxlength="4" value="[%$typeread.width%]" class="infoInput"/> W
							<input type="text" name="height" size="5" maxlength="4" value="[%$typeread.height%]" class="infoInput"/> H
							<span class="cautiontitle">[%$ST.typemanage_type_add_typepic_size_mess%]</span>
						</td>
					</tr>
				</table>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2">[%$ST.typemanage_type_add_templatesurl%]</span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_styleid%]</td>
						<td width="85%" class="trtitle02">
							<select size="1" name="styleid" id="styleid" onchange="ondisplaymore(this.value,'#templatediv,#readtemplatediv,#filenamestylediv,#readnamestylediv,#isdatadirdiv','#typeurldiv','trstyle2 displaytrue','trstyle2 displaynone','#templatevalue','[%$tempname.typeindex%]','[%$tempname.typelist%]')" >
								<option [%if $typeread.styleid==2%]selected[%/if%] value="2">[%$ST.typemanage_type_add_styleid_2%]</option>
								<option [%if $typeread.styleid==1%]selected[%/if%] value="1">[%$ST.typemanage_type_add_styleid_1%]</option>
								<option [%if $typeread.styleid==4%]selected[%/if%] value="4">[%$ST.typemanage_type_add_styleid_4%]</option>
								<option [%if $typeread.styleid==3%]selected[%/if%] value="3">[%$ST.typemanage_type_add_styleid_3%]</option>
							</select>
						</td>
					</tr>
					<tr class="trstyle2[%if $typeread.styleid==3%] displaynone[%/if%]" id="templatediv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_template%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="template" id="templatevalue" value="[%$typeread.template%]" id="templatevalue" size="15" maxlength="80" value="list" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selecttempfile_botton%]','iframe:index.php?archive=templatemain&action=listtab&inputtext=templatevalue&listfunction=templatestab&lng=[%$typeread.lng%]&typeclass=article&fileclass=&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">[%$ST.selecttempfile_botton%]</a>
							<span class="cautiontitle">[%$ST.typemanage_type_add_template_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2[%if $typeread.styleid==3%] displaynone[%/if%]" id="readtemplatediv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_readtemplate%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="readtemplate" value="[%$typeread.readtemplate%]" id="readtemplatevalue" size="15" maxlength="80" value="read" class="infoInput"/>
							<a class="filecheck" href="#body" onclick="javascript:parent.windowsdig('[%$ST.selecttempfile_botton%]','iframe:index.php?archive=templatemain&action=listtab&inputtext=readtemplatevalue&listfunction=templatestab&lng=[%$typeread.lng%]&typeclass=article&fileclass=read&freshid='+Math.random()+'&iframename='+self.frameElement.getAttribute('name'),'650px','380px','iframe');">[%$ST.selecttempfile_botton%]</a>
							<span class="cautiontitle">[%$ST.typemanage_type_add_template_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2[%if $typeread.styleid==1 || $typeread.styleid==2%] displaynone[%/if%]" id="typeurldiv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_url%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="typeurl" value="[%$typeread.typeurl%]" size="50" maxlength="80" class="infoInput"/>
							<span class="cautiontitle">[%$ST.typemanage_type_add_url_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2[%if $typeread.styleid==3%] displaynone[%/if%]" id="filenamestylediv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_filenamestyle%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="filenamestyle" value="[%$typeread.filenamestyle%]" size="25" maxlength="30" class="infoInput"/>
							<span class="cautiontitle">[%$ST.typemanage_type_add_filenamestyle_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2[%if $typeread.styleid==3%] displaynone[%/if%]" id="readnamestylediv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_readnamestyle%]</td>
						<td width="85%" class="trtitle02">
							<input type="text" name="readnamestyle" value="[%$typeread.readnamestyle%]" size="25" maxlength="30" class="infoInput"/>
							<span class="cautiontitle">[%$ST.typemanage_type_add_readnamestyle_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2[%if $typeread.styleid==3%] displaynone[%/if%]" id="isdatadirdiv">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_isdatadir%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="isdatadir"[%if $typeread.isdatadir==1%]checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="isdatadir"[%if $typeread.isdatadir==0%]checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.typemanage_type_add_isdatadir_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_ismenu%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="ismenu"[%if $typeread.ismenu==1%]checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							       <input type="radio" value="0" name="ismenu"[%if $typeread.ismenu==0%]checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							       <span class="cautiontitle">[%$ST.typemanage_type_add_ismenu_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_isaccessory%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="isaccessory"[%if $typeread.isaccessory==1%]checked="checked"[%/if%]/> [%$ST.open_botton_title%]&nbsp;
							<input type="radio" value="0" name="isaccessory"[%if $typeread.isaccessory==0%]checked="checked"[%/if%]/> [%$ST.close_botton_title%]
							<span class="cautiontitle">[%$ST.typemanage_type_add_isaccessory_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_pageclass%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="pageclass"[%if $typeread.pageclass==1%] checked="checked"[%/if%]/> [%$ST.typemanage_type_add_pageclass_1%]&nbsp;
							<input type="radio" value="0" name="pageclass"[%if $typeread.pageclass==0%] checked="checked"[%/if%]/> [%$ST.typemanage_type_add_pageclass_0%]
							<span class="cautiontitle">[%$ST.typemanage_type_add_pageclass_mess%]</span>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01">[%$ST.typemanage_type_add_ispart%]</td>
						<td width="85%" class="trtitle02">
							<input type="radio" value="1" name="ispart"[%if $typeread.ispart==1%] checked="checked"[%/if%]/> [%$ST.typemanage_type_add_ispart_1%]&nbsp;
							<input type="radio" value="0" name="ispart"[%if $typeread.ispart==0%] checked="checked"[%/if%]/> [%$ST.typemanage_type_add_ispart_0%]
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div id="downbotton">
		<div id="subbotton">
			<table border="0" width="100%">
				<tr>
					<td id="right"><input type="submit" name="Submit" value="[%$ST.botton_edit%]" class="buttonface" /></td>
					<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="[%$ST.botton_edit_reset%]" class="buttonface" /></td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>